#include <iostream>
#include <cmath>
using namespace std;

int maxT(int a,int b,int c)
{
	int temp = a>=b?a:b;
	temp = temp>c?temp:c;
	return temp;
}
int main()
{
	int P,T,G1,G2,G3,GJ;
	float score;
	while(cin>>P>>T>>G1>>G2>>G3>>GJ)
	{
		if(abs(G1-G2)<=T)score=(G1+G2)/2.0;
		else
		{
			if(abs(G1-G3)<=T&&abs(G2-G3)<=T)score=maxT(G1,G2,G3);
			else if(abs(G1-G3)>T&&abs(G2-G3)>T)score=GJ;
			else score=((abs(G1-G3)>abs(G2-G3)?G2:G1)+G3)/2.0;
		}
		printf("%0.1f\n",score);
	}
}